import request from '@/utils/request.ts'


/*查询流程定义列表*/
export const taskList = (data: any) => {
    return request({
        url: '/flowable/task/taskList',
        method: 'get',
        data: data
    })
}
/*删除流程定义*/
export const start = (processDefinitionId: string) => {
    return request({
        url: `/flowable/task/start`,
        method: 'post',
        params: {
            processDefinitionId
        }
    })
}
/*流程状态改变*/
export const definitionStatus = (id: string, suspendState: string) => {
    return request({
        url: `/flowable/definition/status`,
        method: 'put',
        params: {
            id,
            suspendState
        }
    })
}

export const getProcessDefinition = (key: string) => {
    return request({
        url: `/flowable/definition/getProcessDefinition`,
        method: 'get',
        params: {
            key
        }
    })
}
/**
 * 删除我的流程
 * @param instanceId
 * @param deleteReason
 */
export const myTaskDelete = (instanceId: string, deleteReason: string) => {
    return request({
        url: `/flowable/task/myTaskDelete`,
        method: 'delete',
        params: {
            instanceId,
            deleteReason
        }
    })
}

